package aufgabe1;

import java.util.Comparator;

public class TestDriver {

	/**
	 * @author Benny
	 * @param args
	 */
	public static void main(String[] args) {

		treeTest01();
		// treeTest02();
		// treeTest03();

	}

	private static void treeTest03() {
		RedBlackTree_own<Integer> tree03 = new RedBlackTree_own<Integer>();
		// tree03.insert(new Integer(1), new IntegerComparator());

		tree03.showTreeGraphic("RBT_03 by Benjamin Zwanzger");
		System.out.println("Die Tiefe des Baumes 03 ist: " + tree03.getDepth());
	}

	private static void treeTest02() {
		RedBlackTree_own<Integer> tree02 = new RedBlackTree_own<Integer>();

		tree02.insert(new Integer(1), new IntegerComparator());
		tree02.insert(new Integer(80), new IntegerComparator());
		tree02.insert(new Integer(21), new IntegerComparator());
		tree02.insert(new Integer(3), new IntegerComparator());
		tree02.insert(new Integer(2), new IntegerComparator());
		tree02.insert(new Integer(9), new IntegerComparator());
		tree02.insert(new Integer(11), new IntegerComparator());
		tree02.insert(new Integer(18), new IntegerComparator());
		tree02.insert(new Integer(25), new IntegerComparator());
		tree02.insert(new Integer(10), new IntegerComparator());
		tree02.insert(new Integer(4), new IntegerComparator());
		tree02.insert(new Integer(5), new IntegerComparator());
		tree02.insert(new Integer(6), new IntegerComparator());

		tree02.showTreeGraphic("RBT_02 by Benjamin Zwanzger");
		System.out.println("Die Tiefe des Baumes 02 ist: " + tree02.getDepth());

	}

	public static void treeTest01() {
		RedBlackTree_own<Integer> tree01 = new RedBlackTree_own<Integer>();

		tree01.insert(new Integer(20), new IntegerComparator());
		tree01.insert(new Integer(15), new IntegerComparator());
		tree01.insert(new Integer(30), new IntegerComparator());
		tree01.insert(new Integer(12), new IntegerComparator());
		tree01.insert(new Integer(3), new IntegerComparator());
		tree01.insert(new Integer(8), new IntegerComparator());

		tree01.showTreeGraphic("RBT_01 by Benjamin Zwanzger");
		// System.out.println(tree.getRoot().getRight().getLeft().getKey());
		// System.out.println(tree.getRoot().getRight().getLeft().isLeaf());

		System.out.println("Die Tiefe des Baumes 01 ist: " + tree01.getDepth());

	}

}
